package com.iyundao.io.mapper;

import com.iyundao.io.model.SignInImage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SignInImageMapper {
    @Insert({
        "insert into signinimage (id, signinid, ",
        "signinimage, partymemberid)",
        "values (#{id,jdbcType=INTEGER}, #{signinid,jdbcType=INTEGER}, ",
        "#{signinimage,jdbcType=VARCHAR}, #{partymemberid,jdbcType=INTEGER})"
    })
    int insert(SignInImage record);

    @InsertProvider(type=SignInImageSqlProvider.class, method="insertSelective")
    int insertSelective(SignInImage record);

    @Select("select signinimage from signinimage where signinid in (select id from signin where activityid=#{activityid,jdbcType=INTEGER})")
    List<String> selectAllUrlByActivityId(Integer activityid);
}